All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JInternalFrame
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JInternalFrame
- public class JInternalFrame
- extends JComponent
- implements Accessible, MouseListener, MouseMotionListener, WindowConstants, RootPaneContainer, ComponentListener
A lightweight object that provides many of the features of
a native frame, including dragging, closing, becoming an icon,
resizing, title display, and support for a menu bar. Generally,
you create an instance and add it to a JDesktopPane. Look and
feel specific-actions are then (automatically??) delegated to the
DesktopManager object maintained by the JDesktopPane (as set by
the UI).
The JInternalFrame contentPane
is where you add child components.
So, to create a JInternalFrame that has a number of buttons arranged
with a BorderLayout object, you might do something like this:
JComponent c = frame.getContentPane();
c.setLayoutManager(new BorderLayout());
c.add(new JButton(), BorderLayout.NORTH);
c.add(new JButton(), BorderLayout.CENTER);
The contentPane
is actually managed by an instance of JRootPane,
which also manages a layoutPane
, glassPane
, and
optional menuBar
for the frame. Please see the JRootPane
documentation for a complete description of these components.
For the keyboard keys used by this component in the standard Look and
Feel (L&F) renditions, see the
JInternalFrame key assignments.
Warning: serialized objects of this class will not be compatible with
future swing releases. The current serialization support is appropriate
for short term storage or RMI between Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
- See Also:
- JDesktopPane, DesktopManager, JInternalFrame. JDesktopIcon, JRootPane
-
closable
- The frame can be closed.
-
CONTENT_PANE_PROPERTY
- Bound property name.
-
desktopIcon
-
The icon that is displayed when the frame is iconized.
-
frameIcon
- The icon shown in the top-left corner of the frame.
-
GLASS_PANE_PROPERTY
- Bound property name.
-
iconable
-
The frame can "iconized" (shrunk down and displayed as
an icon-image).
-
IS_CLOSED_PROPERTY
- Constrained property name indicating that the frame is closed.
-
IS_ICON_PROPERTY
- Constrained property name indicating that the frame is iconified.
-
IS_MAXIMUM_PROPERTY
- Constrained property name indicating that the frame is maximized.
-
IS_SELECTED_PROPERTY
- Constrained property name indicated that this frame has selected status.
-
isClosed
- The frame has been closed.
-
isIcon
-
The frame has been iconized.
-
isMaximum
-
The frame has been expanded to its maximum size.
-
isSelected
- The frame is currently selected.
-
LAYERED_PANE_PROPERTY
- Bound property name.
-
maximizable
- The frame can be expanded to the size of the desktop pane.
-
MENU_BAR_PROPERTY
- Bound property name.
-
resizable
- The frame's size can be changed.
-
ROOT_PANE_PROPERTY
- Bound property name.
-
rootPane
- The JRootPane instance that manages the
contentPane
and optional menuBar
for this frame, as well as the
glassPane
.
-
rootPaneCheckingEnabled
- If true then calls to
add
and setLayout
cause an exception to be thrown.
-
title
- The title displayed in the frame's title bar.
-
TITLE_PROPERTY
- Bound property name.
-
JInternalFrame()
-
Creates a non-resizable, non-closable, non-maximizable,
non-iconifiable JInternalFrame with no title.
-
JInternalFrame(String)
-
Creates a non-resizable, non-closable, non-maximizable,
non-iconifiable JInternalFrame with the specified title.
-
JInternalFrame(String, boolean)
-
Creates a non-closable, non-maximizable, non-iconifiable
JInternalFrame with the specified title and with resizability
specified.
-
JInternalFrame(String, boolean, boolean)
-
Creates a non-maximizable, non-iconifiable JInternalFrame with the
specified title and with resizability and closability specified.
-
JInternalFrame(String, boolean, boolean, boolean)
-
Creates a non-iconifiable JInternalFrame with the specified title
and with resizability, closability, and maximizability specified.
-
JInternalFrame(String, boolean, boolean, boolean, boolean)
-
Creates a JInternalFrame with the specified title and
with resizability, closability, maximizability, and iconifiability
specified.
-
addImpl(Component, Object, int)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead.
-
addInternalFrameListener(InternalFrameListener)
- Adds the specified internal frame listener to receive internal frame events from
this internal frame.
-
componentHidden(ComponentEvent)
-
-
componentMoved(ComponentEvent)
-
-
componentResized(ComponentEvent)
- Invoked when a maximized JInternalFrame's parent's size changes.
-
componentShown(ComponentEvent)
-
-
createRootPane()
-
Called by the constructor to set up the JRootPane.
-
dispose()
- Disposes of this internal frame.
-
getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
-
getBackground()
- Get the background color of this object.
-
getContentPane()
-
-
getDefaultCloseOperation()
- Returns the default operation which occurs when the user
initiates a "close" on this window.
-
getDesktopIcon()
-
Returns the JDesktopIcon used when this JInternalFrame is iconified.
-
getDesktopPane()
- Convenience method that searchs the anscestor heirarchy for a
JDesktop instance.
-
getForeground()
- Get the foreground color of this object.
-
getFrameIcon()
-
Returns the image displayed in the title bar of the frame (usually
in the top-left corner).
-
getGlassPane()
-
-
getLayer()
- Convenience method for getting the layer attribute of this component.
-
getLayeredPane()
-
-
getMenuBar()
- Returns the current JMenuBar for this JInternalFrame, or null
if no menu bar has been set.
-
getRootPane()
- Returns the JRootPane ancestor for a component
-
getTitle()
- Returns the title of the JInternalFrame.
-
getUI()
- Returns the L&F object that renders this component.
-
getUIClassID()
- Returns the name of the L&F class that renders this component.
-
getWarningString()
- Gets the warning string that is displayed with this window.
-
isClosable()
-
Returns whether this JInternalFrame be closed by some user action.
-
isClosed()
-
Returns whether this JInternalFrame is currently closed.
-
isIcon()
-
Returns whether the JInternalFrame is currently iconified.
-
isIconifiable()
-
Returns whether the JInternalFrame can be iconified by some user action.
-
isMaximizable()
-
Returns whether the JInternalFrame can be maximized by some user action.
-
isMaximum()
-
Returns whether the JInternalFrame is currently maximized.
-
isResizable()
-
Returns whether the JInternalFrame can be resized by some user action.
-
isRootPaneCheckingEnabled()
- Returns whether calls to
add
and
setLayout
cause an exception to be thrown.
-
isSelected()
- Returns whether the JInternalFrame is the currently "selected" or
active frame.
-
mouseClicked(MouseEvent)
-
Ignore mouseClicked events.
-
mouseDragged(MouseEvent)
-
Ignore mouseDragged events.
-
mouseEntered(MouseEvent)
-
Forward the mouseEntered event to the underlying child container.
-
mouseExited(MouseEvent)
-
Forward the mouseExited event to the underlying child container.
-
mouseMoved(MouseEvent)
-
Forward the mouseMoved event to the underlying child container.
-
mousePressed(MouseEvent)
- When inactive, mouse events are forwarded as appropriate either to
the UI to activate the frame or to the underlying child component.
-
mouseReleased(MouseEvent)
-
Ignore mouseReleased events.
-
moveToBack()
- Convenience method that moves this component to position -1 if it's
parent is a JLayeredPane.
-
moveToFront()
- Convenience method that moves this component to position 0 if it's
parent is a JLayeredPane.
-
pack()
- Causes subcomponents of this JInternalFrame to be laid out at their
preferred size.
-
processEvent(AWTEvent)
- Processes events on this internal frame.
-
removeInternalFrameListener(InternalFrameListener)
- Removes the specified internal frame listener so that it no longer
receives internal frame events from this internal frame.
-
reshape(int, int, int, int)
- Moves and resizes this component.
-
setBackground(Color)
- Set the background color of this object.
-
setClosable(boolean)
-
Set that this JInternalFrame can be closed by some user action.
-
setClosed(boolean)
-
Calling this method with a value of
true
to close
the frame.
-
setContentPane(Container)
- Sets this JInternalFrame's content pane.
-
setDefaultCloseOperation(int)
- Sets the operation which will happen by default when
the user initiates a "close" on this window.
-
setDesktopIcon(JInternalFrame. JDesktopIcon)
- Sets the JDesktopIcon associated with this JInternalFrame.
-
setForeground(Color)
- Set the foreground color of this object.
-
setFrameIcon(Icon)
-
Sets an image to be displayed in the titlebar of the frame (usually
in the top-left corner).
-
setGlassPane(Component)
- Sets this JInternalFrame's glass pane.
-
setIcon(boolean)
-
Iconizes and deconizes the frame.
-
setIconifiable(boolean)
-
Set that the JInternalFrame can be made an icon by some user action.
-
setLayer(Integer)
-
Convenience method for setting the layer attribute of this component.
-
setLayeredPane(JLayeredPane)
- Sets this JInternalFrame's layered pane.
-
setLayout(LayoutManager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
-
setMaximizable(boolean)
-
Set that the JInternalFrame can be maximized by some user action.
-
setMaximum(boolean)
- Maximizes and restores the frame.
-
setMenuBar(JMenuBar)
- Sets the JMenuBar for this JInternalFrame.
-
setResizable(boolean)
-
Set that the JInternalFrame can be resized by some user action.
-
setRootPane(JRootPane)
- Set the rootPane property.
-
setRootPaneCheckingEnabled(boolean)
- Determines whether calls to
add
and
setLayout
cause an exception to be thrown.
-
setSelected(boolean)
- Selects and deselects the JInternalFrame.
-
setTitle(String)
-
Sets the JInternalFrame title.
-
setUI(InternalFrameUI)
- Sets the UI delegate for this JInternalFrame.
-
setVisible(boolean)
- Set the visible state of the object.
-
show()
- Shows this internal frame, and brings it to the front.
-
toBack()
- Sends this internal frame to the back.
-
toFront()
- Brings this internal frame to the front.
-
updateUI()
- Notification from the UIManager that the L&F has changed.
rootPane
protected JRootPane rootPane
- The JRootPane instance that manages the
contentPane
and optional menuBar
for this frame, as well as the
glassPane
.
- See Also:
- JRootPane, RootPaneContainer
rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
- If true then calls to
add
and setLayout
cause an exception to be thrown.
closable
protected boolean closable
- The frame can be closed.
isClosed
protected boolean isClosed
- The frame has been closed.
maximizable
protected boolean maximizable
- The frame can be expanded to the size of the desktop pane.
isMaximum
protected boolean isMaximum
- The frame has been expanded to its maximum size.
- See Also:
- maximizable
iconable
protected boolean iconable
- The frame can "iconized" (shrunk down and displayed as
an icon-image).
- See Also:
- JInternalFrame. JDesktopIcon
isIcon
protected boolean isIcon
- The frame has been iconized.
- See Also:
- iconable
resizable
protected boolean resizable
- The frame's size can be changed.
isSelected
protected boolean isSelected
- The frame is currently selected.
frameIcon
protected Icon frameIcon
- The icon shown in the top-left corner of the frame.
title
protected String title
- The title displayed in the frame's title bar.
desktopIcon
protected JInternalFrame. JDesktopIcon desktopIcon
- The icon that is displayed when the frame is iconized.
- See Also:
- iconable
CONTENT_PANE_PROPERTY
public static final String CONTENT_PANE_PROPERTY
- Bound property name.
MENU_BAR_PROPERTY
public static final String MENU_BAR_PROPERTY
- Bound property name.
TITLE_PROPERTY
public static final String TITLE_PROPERTY
- Bound property name.
LAYERED_PANE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
- Bound property name.
ROOT_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
- Bound property name.
GLASS_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
- Bound property name.
IS_SELECTED_PROPERTY
public static final String IS_SELECTED_PROPERTY
- Constrained property name indicated that this frame has selected status.
IS_CLOSED_PROPERTY
public static final String IS_CLOSED_PROPERTY
- Constrained property name indicating that the frame is closed.
IS_MAXIMUM_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
- Constrained property name indicating that the frame is maximized.
IS_ICON_PROPERTY
public static final String IS_ICON_PROPERTY
- Constrained property name indicating that the frame is iconified.
JInternalFrame
public JInternalFrame()
- Creates a non-resizable, non-closable, non-maximizable,
non-iconifiable JInternalFrame with no title.
JInternalFrame
public JInternalFrame(String title)
- Creates a non-resizable, non-closable, non-maximizable,
non-iconifiable JInternalFrame with the specified title.
- Parameters:
- title - the String to display in the title bar.
JInternalFrame
public JInternalFrame(String title,
boolean resizable)
- Creates a non-closable, non-maximizable, non-iconifiable
JInternalFrame with the specified title and with resizability
specified.
- Parameters:
- title - the String to display in the title bar.
- resizable - if true, the frame can be resized
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable)
- Creates a non-maximizable, non-iconifiable JInternalFrame with the
specified title and with resizability and closability specified.
- Parameters:
- title - the String to display in the title bar.
- resizable - if true, the frame can be resized
- closable - if true, the frame can be closed
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable,
boolean maximizable)
- Creates a non-iconifiable JInternalFrame with the specified title
and with resizability, closability, and maximizability specified.
- Parameters:
- title - the String to display in the title bar.
- resizable - if true, the frame can be resized
- closable - if true, the frame can be closed
- maximizable - if true, the frame can be maximized
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable,
boolean maximizable,
boolean iconifiable)
- Creates a JInternalFrame with the specified title and
with resizability, closability, maximizability, and iconifiability
specified.
- Parameters:
- title - the String to display in the title bar.
- resizable - if true, the frame can be resized
- closable - if true, the frame can be closed
- maximizable - if true, the frame can be maximized
- iconifiable - if true, the frame can be iconified
createRootPane
protected JRootPane createRootPane()
- Called by the constructor to set up the JRootPane.
- See Also:
- JRootPane
getUI
public InternalFrameUI getUI()
- Returns the L&F object that renders this component.
- Returns:
- the InternalFrameUI object that renders this component
setUI
public void setUI(InternalFrameUI ui)
- Sets the UI delegate for this JInternalFrame.
updateUI
public void updateUI()
- Notification from the UIManager that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager.
- Overrides:
- updateUI in class JComponent
- See Also:
- updateUI
getUIClassID
public String getUIClassID()
- Returns the name of the L&F class that renders this component.
- Returns:
- "InternalFrameUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
- Returns whether calls to
add
and
setLayout
cause an exception to be thrown.
- Returns:
- true if
add
and setLayout
are checked
- See Also:
- addImpl, setLayout, setRootPaneCheckingEnabled
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
- Determines whether calls to
add
and
setLayout
cause an exception to be thrown.
- Parameters:
- enabled - a boolean value, true if checking is to be
enabled, which cause the exceptions to be thrown
- See Also:
- addImpl, setLayout, isRootPaneCheckingEnabled
addImpl
protected void addImpl(Component comp,
Object constraints,
int index)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead. For example:
thisComponent.getContentPane().add(child)
An attempt to add to directly to this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- addImpl in class Container
- See Also:
- setRootPaneCheckingEnabled
setLayout
public void setLayout(LayoutManager manager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
For example:
thiComponent.getContentPane().setLayout(new BorderLayout())
An attempt to set the layout of this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- setLayout in class Container
- See Also:
- setRootPaneCheckingEnabled
getMenuBar
public JMenuBar getMenuBar()
- Returns the current JMenuBar for this JInternalFrame, or null
if no menu bar has been set.
- Returns:
- the JMenuBar used by this frame
- See Also:
- setMenuBar
setMenuBar
public void setMenuBar(JMenuBar m)
- Sets the JMenuBar for this JInternalFrame.
- Parameters:
- m - the JMenuBar to use in this frame
- See Also:
- getMenuBar
getContentPane
public Container getContentPane()
setContentPane
public void setContentPane(Container c)
- Sets this JInternalFrame's content pane.
- Parameters:
- c - the Container to use for the contents of this JInternalFrame
- Throws: IllegalComponentStateException
- (a runtime
exception) if the content pane parameter is null
- See Also:
- getContentPane
getLayeredPane
public JLayeredPane getLayeredPane()
setLayeredPane
public void setLayeredPane(JLayeredPane layered)
- Sets this JInternalFrame's layered pane.
- Throws: IllegalComponentStateException
- (a runtime
exception) if the layered pane parameter is null
- See Also:
- setLayeredPane
getGlassPane
public Component getGlassPane()
setGlassPane
public void setGlassPane(Component glass)
- Sets this JInternalFrame's glass pane.
- See Also:
- getGlassPane
getRootPane
public JRootPane getRootPane()
- Returns the JRootPane ancestor for a component
- Overrides:
- getRootPane in class JComponent
setRootPane
protected void setRootPane(JRootPane root)
- Set the rootPane property. This method is called by the constructor.
setVisible
public void setVisible(boolean b)
- Set the visible state of the object.
- Parameters:
- b - if true, shows this object; otherwise, hides it
- Overrides:
- setVisible in class JComponent
setClosable
public void setClosable(boolean b)
- Set that this JInternalFrame can be closed by some user action.
- Parameters:
- b - a boolean value, where true means the frame can be closed
isClosable
public boolean isClosable()
- Returns whether this JInternalFrame be closed by some user action.
- Returns:
- true if the frame can be closed
isClosed
public boolean isClosed()
- Returns whether this JInternalFrame is currently closed.
- Returns:
- true if the frame is closed
setClosed
public void setClosed(boolean b) throws PropertyVetoException
- Calling this method with a value of
true
to close
the frame.
- Parameters:
- b - a boolean, where true means "close the frame"
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
setResizable
public void setResizable(boolean b)
- Set that the JInternalFrame can be resized by some user action.
- Parameters:
- b - a boolean, where true means the frame can be resized
isResizable
public boolean isResizable()
- Returns whether the JInternalFrame can be resized by some user action.
- Returns:
- true if the frame can be resized
setIconifiable
public void setIconifiable(boolean b)
- Set that the JInternalFrame can be made an icon by some user action.
- Parameters:
- b - a boolean, where true means the frame can be iconified
isIconifiable
public boolean isIconifiable()
- Returns whether the JInternalFrame can be iconified by some user action.
- Returns:
- true if the frame can be iconified
isIcon
public boolean isIcon()
- Returns whether the JInternalFrame is currently iconified.
- Returns:
- true if the frame is iconified
setIcon
public void setIcon(boolean b) throws PropertyVetoException
- Iconizes and deconizes the frame.
- Parameters:
- b - a boolean, where true means to iconify the frame and
false means to deiconify it
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
setMaximizable
public void setMaximizable(boolean b)
- Set that the JInternalFrame can be maximized by some user action.
- Parameters:
- b - a boolean where true means the frame can be maximized
isMaximizable
public boolean isMaximizable()
- Returns whether the JInternalFrame can be maximized by some user action.
- Returns:
- true if the frame can be maximized
isMaximum
public boolean isMaximum()
- Returns whether the JInternalFrame is currently maximized.
- Returns:
- true if the frame is maximized
setMaximum
public void setMaximum(boolean b) throws PropertyVetoException
- Maximizes and restores the frame. A maximized frame is resized to
fully fit the JDesktopPane area associated with the JInternalFrame.
A restored frame's size is set to the JInternalFrame's actual size.
- Parameters:
- b - a boolean, where true maximizes the frame and false
restores it
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
getTitle
public String getTitle()
- Returns the title of the JInternalFrame.
- Returns:
- a String containing the frame's title
- See Also:
- setTitle
setTitle
public void setTitle(String title)
- Sets the JInternalFrame title.
- Parameters:
- title - the String to display in the title bar
- See Also:
- title
setSelected
public void setSelected(boolean selected) throws PropertyVetoException
- Selects and deselects the JInternalFrame.
A JInternalFrame normally draws it's title bar differently if it is
the selected frame, which indicates to the user that this
internalFrame has the focus.
- Parameters:
- selected - a boolean, where true means the frame is selected
(currently active) and false means it is not
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
isSelected
public boolean isSelected()
- Returns whether the JInternalFrame is the currently "selected" or
active frame.
- Returns:
- true if the frame is currently selected (active)
- See Also:
- setSelected
setFrameIcon
public void setFrameIcon(Icon icon)
- Sets an image to be displayed in the titlebar of the frame (usually
in the top-left corner).
This image is not the
desktopIcon
object, which
is the image displayed in the JDesktop when the frame is iconified.
- Parameters:
- icon - the Icon to display in the title bar
- See Also:
- desktopIcon
getFrameIcon
public Icon getFrameIcon()
- Returns the image displayed in the title bar of the frame (usually
in the top-left corner).
- Returns:
- the Icon displayed in the title bar
getBackground
public Color getBackground()
- Get the background color of this object.
- Returns:
- the background color, if supported, of the object;
otherwise, null
- Overrides:
- getBackground in class Component
setBackground
public void setBackground(Color c)
- Set the background color of this object.
(For transparency, see
isOpaque
.)
- Parameters:
- c - the new Color for the background
- Overrides:
- setBackground in class Component
- See Also:
- isOpaque
getForeground
public Color getForeground()
- Get the foreground color of this object.
- Returns:
- the foreground color, if supported, of the object;
otherwise, null
- Overrides:
- getForeground in class Component
setForeground
public void setForeground(Color c)
- Set the foreground color of this object.
- Parameters:
- c - the new Color for the foreground
- Overrides:
- setForeground in class Component
moveToFront
public void moveToFront()
- Convenience method that moves this component to position 0 if it's
parent is a JLayeredPane.
moveToBack
public void moveToBack()
- Convenience method that moves this component to position -1 if it's
parent is a JLayeredPane.
setLayer
public void setLayer(Integer layer)
- Convenience method for setting the layer attribute of this component.
- Parameters:
- layer - an Integer object specifying this frame's desktop layer
- See Also:
- JLayeredPane
getLayer
public int getLayer()
- Convenience method for getting the layer attribute of this component.
- Returns:
- an Integer object specifying this frame's desktop layer
- See Also:
- JLayeredPane
getDesktopPane
public JDesktopPane getDesktopPane()
- Convenience method that searchs the anscestor heirarchy for a
JDesktop instance. If JInternalFrame finds none, the desktopIcon
tree is searched.
- Returns:
- the JDesktopPane this frame belongs to, or null if none
is found
setDesktopIcon
public void setDesktopIcon(JInternalFrame. JDesktopIcon d)
- Sets the JDesktopIcon associated with this JInternalFrame.
- Parameters:
- d - the JDesktopIcon to display on the desktop
- See Also:
- desktopIcon
getDesktopIcon
public JInternalFrame. JDesktopIcon getDesktopIcon()
- Returns the JDesktopIcon used when this JInternalFrame is iconified.
- Returns:
- the JDesktopIcon displayed on the desktop
- See Also:
- desktopIcon
reshape
public void reshape(int x,
int y,
int width,
int height)
- Moves and resizes this component. Unlike other components,
this implementation also forces re-layout, so that frame
decorations such as the title bar are always redisplayed.
- Parameters:
- x - an int giving the component's new horizontal position
measured in pixels from the left of its container
- y - an int giving the component's new vertical position,
measured in pixels from the bottom of its container
- width - an int giving the component's new width in pixels
- height - an int giving the component's new height in pixels
- Overrides:
- reshape in class JComponent
addInternalFrameListener
public synchronized void addInternalFrameListener(InternalFrameListener l)
- Adds the specified internal frame listener to receive internal frame events from
this internal frame.
- Parameters:
- l - the internal frame listener
removeInternalFrameListener
public synchronized void removeInternalFrameListener(InternalFrameListener l)
- Removes the specified internal frame listener so that it no longer
receives internal frame events from this internal frame.
- Parameters:
- l - the internal frame listener
processEvent
protected void processEvent(AWTEvent e)
- Processes events on this internal frame. If the event has a
InternalFrameEvent id, it notifies its internalFrameListener, else it
invokes its superclass's processEvent.
- Parameters:
- e - the event
- Overrides:
- processEvent in class Container
setDefaultCloseOperation
public void setDefaultCloseOperation(int operation)
- Sets the operation which will happen by default when
the user initiates a "close" on this window.
The possible choices are:
- DO_NOTHING_ON_CLOSE - do not do anything - require the
program to handle the operation in the windowClosing
method of a registered InternalFrameListener object.
- HIDE_ON_CLOSE - automatically hide the window after
invoking any registered InternalFrameListener objects
- DISPOSE_ON_CLOSE - automatically hide and dispose the
window after invoking any registered InternalFrameListener objects
The value is set to HIDE_ON_CLOSE by default.
- See Also:
- addInternalFrameListener, getDefaultCloseOperation
getDefaultCloseOperation
public int getDefaultCloseOperation()
- Returns the default operation which occurs when the user
initiates a "close" on this window.
- See Also:
- setDefaultCloseOperation
pack
public void pack()
- Causes subcomponents of this JInternalFrame to be laid out at their
preferred size.
- See Also:
- pack
show
public void show()
- Shows this internal frame, and brings it to the front.
If this window is not yet visible, show
makes it visible. If this window is already visible,
then this method brings it to the front.
- Overrides:
- show in class Component
- See Also:
- show, toFront, setVisible
dispose
public void dispose()
- Disposes of this internal frame. If the frame is not already
closed, a frame-closing event is posted.
toFront
public void toFront()
- Brings this internal frame to the front.
Places this internal frame at the top of the stacking order
and makes the corresponding adjustment to other visible windows.
- See Also:
- toFront, moveToFront
toBack
public void toBack()
- Sends this internal frame to the back.
Places this internal frame at the bottom of the stacking order
and makes the corresponding adjustment to other visible windows.
- See Also:
- toBack, moveToBack
getWarningString
public final String getWarningString()
- Gets the warning string that is displayed with this window.
Since an internal frame is always secure (since it's fully
contained within a window which might need a warning string)
this method always returns null.
- Returns:
- null
- See Also:
- getWarningString
mousePressed
public void mousePressed(MouseEvent e)
- When inactive, mouse events are forwarded as appropriate either to
the UI to activate the frame or to the underlying child component.
In keeping with the MDI messaging model (which JInternalFrame
emulates), only the mousePressed event is forwarded to the UI
to activate the frame. The mouseEntered, mouseMoved, and
MouseExited events are forwarded to the underlying child
component, using methods derived from those in Container.
The other mouse events are purposely ignored, since they have
no meaning to either the frame or its children when the frame
is inactive.
mouseEntered
public void mouseEntered(MouseEvent e)
- Forward the mouseEntered event to the underlying child container.
- See Also:
- mousePressed
mouseMoved
public void mouseMoved(MouseEvent e)
- Forward the mouseMoved event to the underlying child container.
- See Also:
- mousePressed
mouseExited
public void mouseExited(MouseEvent e)
- Forward the mouseExited event to the underlying child container.
- See Also:
- mousePressed
mouseClicked
public void mouseClicked(MouseEvent e)
- Ignore mouseClicked events.
- See Also:
- mousePressed
mouseReleased
public void mouseReleased(MouseEvent e)
- Ignore mouseReleased events.
- See Also:
- mousePressed
mouseDragged
public void mouseDragged(MouseEvent e)
- Ignore mouseDragged events.
- See Also:
- mousePressed
componentResized
public void componentResized(ComponentEvent e)
- Invoked when a maximized JInternalFrame's parent's size changes.
componentMoved
public void componentMoved(ComponentEvent e)
componentShown
public void componentShown(ComponentEvent e)
componentHidden
public void componentHidden(ComponentEvent e)
getAccessibleContext
public AccessibleContext getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
- Returns:
- the AccessibleContext of this JComponent
- Overrides:
- getAccessibleContext in class JComponent
All Packages Class Hierarchy This Package Previous Next Index